﻿<UserControl x:Class="ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor.BrushEditorView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:Designer="clr-namespace:ICSharpCode.WpfDesign.Designer"
             xmlns:Controls="clr-namespace:ICSharpCode.WpfDesign.Designer.Controls"
             xmlns:BrushEditor="clr-namespace:ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor"
             xmlns:Converters="clr-namespace:ICSharpCode.WpfDesign.Designer.Converters"
             xmlns:PropertyGrid="clr-namespace:ICSharpCode.WpfDesign.Designer.PropertyGrid"
             xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets"
             Width="395">
	
	<UserControl.Resources>
			
			<DataTemplate DataType="{x:Type BrushEditor:BrushItem}">
				<StackPanel Orientation="Horizontal">
					<Border Background="{Binding Brush}"
					        Width="30"
					        Height="15"
					        Margin="2"
					        BorderThickness="1"
					        BorderBrush="Black" />
					<TextBlock Text="{Binding Name}"
					           VerticalAlignment="Center" />
				</StackPanel>
			</DataTemplate>
	
	</UserControl.Resources>
	
	<TabControl x:Name="tabControl"
	            SelectedIndex="{Binding CurrentKind, Converter={x:Static Converters:IntFromEnumConverter.Instance}}">
		<TabItem Header="None">
			<Border Background="White"
			        BorderThickness="1"
			        BorderBrush="Black"
			        HorizontalAlignment="Center"
			        VerticalAlignment="Center">
				<Line X1="0"
				      Y1="40"
				      X2="70"
				      Y2="0"
				      Stroke="Red"
				      StrokeThickness="1" />
			</Border>
		</TabItem>
		<TabItem Header="Solid">
			<BrushEditor:SolidBrushEditor Color="{Binding Brush.Color}" />
		</TabItem>
		<TabItem Header="Linear">
			<DockPanel>
				<StackPanel DockPanel.Dock="Top"
				            Orientation="Horizontal"
				            Margin="5">
					<TextBlock Text="Angle"
					           VerticalAlignment="Center" />
					<widgets:NumericUpDown Value="{Binding GradientAngle}"
					                 Minimum="-360"
					                 Maximum="360"
					                 Margin="5 0 0 0"
					                 Width="50" />
					<Button Content="H"
					        Command="{Designer:Call MakeGradientHorizontal}"
					        Margin="5 0 0 0"
					        Width="30" />
					<Button Content="V"
					        Command="{Designer:Call MakeGradientVertical}"
					        Margin="5 0 0 0"
					        Width="30" />
				</StackPanel>
				<BrushEditor:GradientBrushEditor />
			</DockPanel>
		</TabItem>
		<TabItem Header="Radial">
			<BrushEditor:GradientBrushEditor />
		</TabItem>
		<TabItem Header="Brush List">
			<ListBox ItemsSource="{Binding AvailableBrushes}"
			         SelectedValue="{Binding Brush.Color}"
			         SelectedValuePath="Brush.Color" />
		</TabItem>
	</TabControl>

</UserControl>
